<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>账户登陆</title>
    <!--css style-->
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="responsive/flexible.css">
    <script src="responsive/flexible.js"></script>
</head>
<body class="personal_center login">
    <header>
        <a href="javascript:void(0)" class="pre_page"></a>
        账户登陆
    </header>

    <section class="main">
       <div class="container">
           <div class="logo">
               <img src="img/logo1.png" alt="">
           </div>
           <form action="" class="login_form">
               <div class="error_message"></div>
               <input type="text" placeholder="手机号/会员名/邮箱" name="user" id="user" class="user" onblur="checkEmpty(this,'用户名不能为空')">
               <input type="text" placeholder="请输入密码" class="password" name="password" id="password" onblur="checkEmpty(this,'密码不能为空')">
               <input type="submit" onclick="checkInfo()" value="立即登陆">
           </form>
           <p><a href="javascript:void(0)" class="forget">忘记密码？</a></p>
           <a href="registration.html" class="free_reg">免费注册</a>
       </div>

    </section>


</body>
<script src="js/jquery.js"></script>
<script>
    /*校验手机号码*/
    function checkTel(obj){
        obj.errorFlag = false;
        if (checkEmpty(obj,'请您填写手机号码')) {
            obj.errorFlag = true;
            return  obj.errorFlag;
        }
        if(!(/^1[3|4|5|7|8]\d{9}$/.test(obj.value))){
            showErrorMessage("输入手机号码不正确");
            obj.errorFlag = true;
        }else{
            clearErrorMessage();
        }
        return  obj.errorFlag;
    }
    /*检测是否为空*/
    function checkEmpty(obj,message){
        if(obj.value==''){
            showErrorMessage(message);
            return true;
        }else{
            clearErrorMessage();
            return false;
        }
    }
    /*检测计算数据*/
    function checkInfo(){
        var elUser=document.getElementById("user");
        var elPassword=document.getElementById("password");




        /*if(checkTel(elTel)){
            $(".bulter_form").submit(false);
            return;
        }*/
        if(checkEmpty(elUser,"用户名不能为空")){
            $(".login_form").submit(false);
            return;
        }
        if(checkEmpty(elPassword,"密码不能为空")){
            $(".login_form").submit(false);
            return;
        }


    }
    function showErrorMessage(message){
        $(".error_message").html("*"+message);
    }

    function clearErrorMessage() {
        $(".error_message").html("");
    }


</script>
</html>